from flask import Blueprint, render_template, request, session
from uuid import uuid4
from flask import redirect

home = Blueprint('home', __name__)


@home.route('/index2', methods=['GET', 'POST'])
def index2():
    # user_info = session.get('user_info')
    # print(user_info)
    print(session.permanent)
    # session['user_info'] = {'k1': 1, 'k2': 2}
    user_info = session.get('user_info')
    print('原来的值', user_info)

    session['user_info']['k1'] = 9999
    user_info = session.get('user_info')
    print('修改后的值', user_info)

    # session['modified'] = True
    return 'index'


@home.route('/test')
def test():

    user_info = session.get('user_info')
    print(user_info)
    return 'test'

